Update reslist limitation

Brightcells 6 年之前
父节点
当前提交
490439c44a
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      statistic/views.py

+ 3 - 3
statistic/views.py

@@ -234,15 +234,15 @@ def ymdtj(brand_id, ymd, lastymd):
234 234
     volume_count_increase_pct = '%.2f' % (sell_volume_count * 100.0 / last_sell_volume_count) if last_sell_volume_count != 0 else 0
235 235
 
236 236
     # 统计周期内型号扫描排行数据,请按顺序返回
237
-    models = ConsumeModelSaleStatisticInfo.objects.filter(brand_id=brand_id, ymd=ymd, status=True).order_by('-num')
237
+    models = ConsumeModelSaleStatisticInfo.objects.filter(brand_id=brand_id, ymd=ymd, status=True).order_by('-num')[:20]
238 238
     models = [m.data for m in models]
239 239
 
240 240
     # 统计周期内销售员排行数据,请按顺序返回
241
-    salesmen = SaleclerkSaleStatisticInfo.objects.filter(brand_id=brand_id, ymd=ymd, status=True).order_by('-num')
241
+    salesmen = SaleclerkSaleStatisticInfo.objects.filter(brand_id=brand_id, ymd=ymd, status=True).order_by('-num')[:20]
242 242
     salesmen = [s.data for s in salesmen]
243 243
 
244 244
     # 统计周期内省份销量排行数据,请按顺序返回
245
-    provinces = ProvinceSaleStatisticInfo.objects.filter(brand_id=brand_id, ymd=ymd, status=True).order_by('position')
245
+    provinces = ProvinceSaleStatisticInfo.objects.filter(brand_id=brand_id, ymd=ymd, status=True)
246 246
     provinces = [p.data for p in provinces]
247 247
 
248 248
     return {